﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DataMappers;
using ExaminationTT.Model;

namespace ConcreteMappersAndObjects.DomainObjects
{
    public struct CourseCUKey
    {
        public CourseCUKey(int cUnitKey, int courseKey)
            : this()
        {
            CUnitKey = cUnitKey;
            CourseKey = courseKey;
        }

        public int CUnitKey { get; private set; }
        public int CourseKey { get; private set; }
    }

    public class CourseCU : DomainObject<CourseCUKey,CourseCU> , ICourseCU
    {

        IValueHolder<int, CUnit> _cunit;
        IValueHolder<int, Course> _course;

        public CourseCU()
            : base()
        {
            _cunit = new ConcreteValueHolder<int, CUnit>();
            _course = new ConcreteValueHolder<int, Course>();
        }

        public CourseCU(IValueHolder<int, CUnit> cUnit, IValueHolder<int, Course> course, CourseCUKey CCUKey)
            : base(CCUKey)
        {
            _cunit = cUnit;
            _course = course;
        }
        public CUnit CUnit { get; private set; }
        public Course Course { get; private set; }
        
        protected override CourseCU Self()
        {
            return this;
        }

        #region IDomainObject<ICourseCUKey,ICourseCU> Members


        
        #endregion


        #region ICourseCU Members

        ICourse ICourseCU.Course
        {
            get { return _course.Get(); }
        }

        ICUnit ICourseCU.CUnit
        {
            get { return _cunit.Get(); }
        }

        #endregion
    }


}
